import { HomeController } from "db://assets/app-builtin/app-controller/HomeController";
import UI_PopInternal from "db://assets/app-bundle/app-fgui/Package1/exported/UI_PopInternal";
import { app } from "db://assets/app/app";
import { FairyPop } from "db://assets/pkg-export/fairygui/FairyGUIView";

export class SimplePop extends FairyPop(UI_PopInternal, HomeController) {
    onUIInit(): void {
        console.log('SimplePop >>>>>>>>>>>>>>> OnUIInit')
        this.m_mask.onClick(this.hide, this)
        this.m_btnJump.onClick(this.onClickJump, this)
    }

    onUIUpdate(params: any): void {
        this.m_txtLabel.i18nText = "test.label";
        console.log('SimplePop >>>>>>>>>>>>>>> OnUIUpdate')
        this.full(true);
        console.log("SimplePop.onUIUpdate", params);
        this.controller.refresh("SimplePop")
    }

    onUIHide(): void {
        console.log('SimplePop >>>>>>>>>>>>>>> OnUIHide')
    }

    onUIDestroy(): void {
        console.log('SimplePop > OnUIDestroy')
    }

    private onClickJump(): void {
        app.manager.ui.show({
            name: 'PageGame'
        });
    }
}